﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BrokerBase.Lib.Policy;

namespace broker.duty.BDFZ
{
    class Class1
    {
        public void Calc1(IPolicyPeriodActing ppa, IDutyActing da)
        {
            if (ppa.Period > 0 && ppa.SchemePeriodActing.InsurantStates.Contains("身故"))
            {

                switch (ppa.Age)
                {
                    case 0:
                        da.Value = ppa.Amount * 0.2;
                        break;
                    case 1:
                        da.Value = ppa.Amount * 0.4;
                        break;
                    case 2:
                        da.Value = ppa.Amount * 0.6;
                        break;
                    case 3:
                        da.Value = ppa.Amount * 0.8;
                        break;
                    default:
                        da.Value = ppa.Amount;
                        break;
                }
                ppa.IsCurrentFinish = true;
            }
        }

        public void Calc1(IPolicyPeriodActing ppa, IDutyActing da)
        {
            if (ppa.Period > 0)
            {
                double f = (double)ppa.SchemePeriodActing.SchemeActing.GetAuxConfigValue("分红率(预估)");

                da.Value = ppa.TotalFee * f;
            }
        }
    }
}
